package demoMod.invincibleOne.dynamicVariables;

import basemod.abstracts.DynamicVariable;
import com.megacrit.cardcrawl.cards.AbstractCard;
import demoMod.invincibleOne.cards.invincible.AbstractInvincibleCard;

public class AnotherMagicNumber extends DynamicVariable {
    @Override
    public String key() {
        return "invM2";
    }

    @Override
    public boolean isModified(AbstractCard c) {
        if (c instanceof AbstractInvincibleCard) {
            AbstractInvincibleCard invincibleCard = (AbstractInvincibleCard) c;
            return invincibleCard.baseM2 != invincibleCard.m2;
        }
        return false;
    }

    @Override
    public int value(AbstractCard c) {
        if (c instanceof AbstractInvincibleCard) {
            AbstractInvincibleCard invincibleCard = (AbstractInvincibleCard) c;
            return invincibleCard.m2;
        }
        return 0;
    }

    @Override
    public int baseValue(AbstractCard c) {
        if (c instanceof AbstractInvincibleCard) {
            AbstractInvincibleCard invincibleCard = (AbstractInvincibleCard) c;
            return invincibleCard.baseM2;
        }
        return 0;
    }

    @Override
    public boolean upgraded(AbstractCard c) {
        if (c instanceof AbstractInvincibleCard) {
            AbstractInvincibleCard invincibleCard = (AbstractInvincibleCard) c;
            return invincibleCard.baseM2 != invincibleCard.m2;
        }
        return false;
    }
}
